home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / JForth / JTools / Janim / anim.j < prev    next >
Encoding:
Text File  |  1991-11-15  |  2.3 KB  |  100 lines

  1. \ ANIM.h: structures and constants for ANIM support
  2. \ for JFORTH
  3. \ Author: Martin Kees    10/13/90
  4. \ Copyright: 1990 Martin Kees
  5. \ Freely distributable to the JForth Community
  6. \ MOD: MCK 11/22/90 added DPAN stuff
  7. \ MOD: MCK 2/9/91   name change > abr for all animbrush refs
  8. \ MOD: MCK 2/11/91  ANIM-ERROR added
  9. \ MOD: PLB 10/25/91 Changed some longs to RPTR
  10.  
  11. \ Define special structure for manipulating IFF ANIM-5 animations.
  12. \ Pointers are relative pointers.
  13. :STRUCT ANIMATION
  14.     struct picture  an_pic0
  15.     long   an_key
  16.     rptr   an_DELTAlist        \ pointer to list of pointers to DELTAs
  17.     rptr   an_ytable
  18.     short  an_cels
  19.     short  an_atdelta
  20.     long   an_flags
  21. \
  22. \ these members differ from ANIMBRUSHes
  23.     struct picture  an_pic1
  24.     rptr   an_displaying       \ pointer to picture current displayed
  25.     rptr   an_hiding           \ pointer to picture current hidden
  26.     long   an_CAMG
  27.     rptr   an_Seeklist         \ for HD
  28.     rptr   an_Sizelist         \ FOR HDdisk player
  29.     rptr   an_$filename        \ FOr HDdisk player
  30. ;STRUCT
  31.  
  32.  
  33. $ 67676767 CONSTANT ANIM_VALID_KEY
  34.  
  35. 0 CONSTANT Anim_MEMmode
  36. 1 CONSTANT Anim_DISKmode
  37. 1 CONSTANT ANIM_LOOP
  38. 0 CONSTANT ANIM_ONETIME
  39.  
  40. \ Define special structure for manipulating DpaintIII ANIM-Brushes.
  41. \ Pointers are relative pointers.
  42. :STRUCT ANIMBrush
  43.     struct picture  abr_pic0
  44.     long   abr_key
  45.     rptr   abr_DELTAlist        \ pointer
  46.     rptr   abr_ytable
  47.     short  abr_cels
  48.     short  abr_atdelta
  49.     long   abr_flags
  50. \
  51. \ These differ from ANIMATIONs
  52.     long   abr_direction
  53. ;STRUCT
  54.  
  55.  1 CONSTANT ABR_FORWARD
  56. -1 CONSTANT ABR_BACKWARD
  57.  4 CONSTANT ABR_Loop
  58.  8 CONSTANT ABR_PingPong
  59.  
  60. $ 6868686868 CONSTANT Abr_Valid_Key
  61.  
  62. CHKID ANIM 'ANIM'
  63. CHKID ANHD 'ANHD'
  64. CHKID DLTA 'DLTA'
  65. CHKID DPAN 'DPAN'
  66.  
  67. :STRUCT ANHD
  68.  ubyte ah_operation
  69.  ubyte ah_mask
  70.  short ah_w
  71.  short ah_h
  72.  short ah_x
  73.  short ah_y
  74.  long  ah_abstime
  75.  long  ah_reltime
  76.  ubyte ah_interleave
  77.  byte  ah_pad0
  78.  long  ah_bits
  79.  16 bytes ah_pad16
  80. ;STRUCT
  81.  
  82. \ This is guess work by looking at DPaintIII files
  83. :STRUCT DPAN
  84.     ushort    dp_code     \ seems to be 3 always
  85.     ushort    dp_frames   \ number of actual frames not counting loop deltas
  86.     ubyte    dp_rate     \ in frames/sec?
  87.     ubyte    dp_mode     \ 0=forward 2=pingpong 5=reverse   
  88.     ushort    dp_dur      \ animbrush duration setting ?
  89. ;STRUCT 
  90.  
  91. variable ANIM-ERROR ANIM-ERROR OFF
  92.  
  93. : <anim.error> ( $errormsg -- )
  94.   $type cr
  95.   ANIM-ERROR ON
  96. ;  
  97.  
  98. DEFER anim.error
  99. ' <anim.error> is anim.error
  100.